﻿using MediatR;
using RBAC.Domain;
using RBAC.Domain.Service.Interfae;
using RBACDuYaJun.Api.Appliction.Command.UserCommand;

namespace RBACDuYaJun.Api.Appliction.CommandHandlers.UserHanders
{
    /// <summary>
    /// 所在县
    /// </summary>
    public class CountryShowCommandHandler : IRequestHandler<CountryShowCommand, List<Country>>
    {
        private readonly ICountryService _countryService;
         
        public CountryShowCommandHandler(ICountryService countryService)
        {
            _countryService = countryService;
        }

        public async Task<List<Country>> Handle(CountryShowCommand request, CancellationToken cancellationToken)
        {
            return await _countryService.GetCountries(request.CityId);
        }
    }
}
